/********************************************************************************
*																				*
*  Las Venturas Playground - callbacks/onPlayerCommand.nut						*
*																				*
*  The onPlayerCommand callback is located here.								*
*																				*
********************************************************************************/

local commandHandlers = [];
function registerCommandHandler (cmdHandler)
{
    commandHandlers.append (cmdHandler);
}

function onPlayerCommand(playerid, command)
{
    local found = false;
    foreach (cmdHandler in commandHandlers) {
        if (cmdHandler.onCommand (playerid, command)) found = true;
    }
    
    if (!found) {
        sendPlayerMessage (playerid, "SERVER: Unknown command", 0xFFFFFFFF, false);
    }
    
    return true;
}

addEvent("playerCommand", onPlayerCommand);